package pro.shuangxi.model.book.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mybatisplus.pojo.Book;
import mybatisplus.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author mengshx
 * @since 2020-12-27
 */
@Controller
public class BookController {
    @Autowired
    IBookService bookService;
    @RequestMapping("/queryMyBooks.do")
    @ResponseBody
    public List<Book> queryMyBooks(Integer accountid){
        return bookService.list(new QueryWrapper<Book>().eq("owner", accountid));
    }

}

